<?php

namespace frontend\controllers;

use Yii;
use common\models\meeting\Meeting;
use common\models\meeting\MeetingSearch;
use common\models\meeting\MeetingSign;
use common\models\meeting\Meetingenroll;
use common\models\AdminLog\AdminLog;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\data\Pagination;
use yii\base\Object;
use common\models\category\Category;
use yii\web\UploadedFile;
use zhongkefu\zhongkefu;
use zhongkefu\helpers\Utils;
use kartik\file\FileInput;//图片上传
use dosamigos\qrcode\QrCode;


/**
 * ArticlesController implements the CRUD actions for Articles model.
 */
class CodeController extends Controller
{
    public $layout = 'code';
    /**
     * 报名
     * $id 会议id
     */
    public function actionZy()
    {
        $pingzheng= Yii::$app->request->get()["code"];
        $pingzhengcode =  Yii::$app->params['htwz'].'/code/zy/?code='.$pingzheng;
        QrCode::png($pingzhengcode,'upload/erm/'.$pingzheng.'.png', 'L', 20, 2); 
        $qrimg =  Yii::$app->request->hostInfo.'/upload/erm/'.$pingzheng.'.png';
        $arr = str_split($pingzheng, 3);
        $codem = implode('-',$arr);
        return $this->render('codeyz',['code'=>$qrimg,'codem'=>$codem]);
    }
    	
}
